﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCRUM.Core.BusinessObjects;
using SCRUM.Core.DataProviders;
using System.Collections;
using System.Collections.Specialized;

namespace SCRUM.Core.DAO
{
    /// <summary>
    /// Access object for states
    /// </summary>
    public class DAOState
    {
        /// <summary>
        /// State of project
        /// </summary>
        public static string Project = "PROJECT";

        /// <summary>
        /// State of sprint
        /// </summary>
        public static string Sprint = "SPRINT";

        /// <summary>
        /// State of userStory
        /// </summary>
        public static string UserStory = "USER_STORY";

        /// <summary>
        /// State of BLI
        /// </summary>
        public static string BLI = "BLI";

        /// <summary>
        /// State of task
        /// </summary>
        public static string Task = "TASK";

        /// <summary>
        /// Returns all states of specific type
        /// </summary>
        /// <param name="type">Type of state</param>
        /// <returns>List of all states for specific type</returns>
        public static IList<State> GetAllStatesForType(State.StateTypes type)
        {
            return ProviderFactory.Provider.GetAllStates(type);
        }

        /// <summary>
        /// Returns state of specific type for specific ID.
        /// </summary>
        /// <param name="stateId">ID of state.</param>
        /// <param name="type">Type of state.</param>
        /// <returns>State object for specific ID.</returns>
        public static State GetStateForType(int stateId, State.StateTypes type)
        {
            return ProviderFactory.Provider.GetStateForType(stateId, type);
        }

        /// <summary>
        /// Creates new state.
        /// </summary>
        /// <param name="state">State to create.</param>
        public static void CreateNewState(State state)
        {
            ProviderFactory.Provider.CreateState(state);
        }

        /// <summary>
        /// Deletes state.
        /// </summary>
        /// <param name="state">State to delete.</param>
        public static void DeleteState(State state)
        {
            ProviderFactory.Provider.DeleteState(state);
        }
        
        /// <summary>
        /// Updates state.
        /// </summary>
        /// <param name="state">State to delete.</param>
        public static void UpdateState(State state)
        {
            ProviderFactory.Provider.UpdateState(state);
        }
    }
}
